<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Lua: getting started</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
<LINK REL="stylesheet" TYPE="text/css" HREF="lua2.css">
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>

<BODY>

<HR>
<H1>
<A HREF="home.html"><IMG SRC="images/logo.gif" ALT="Lua" BORDER=0></A>
Getting started
</H1>

<A HREF="#what">what is it</A>
&middot;
<A HREF="#installing">installing</A>
&middot;
<A HREF="#learning">learning</A>
&middot;
<A HREF="#help">getting help</A>
&middot;
<A HREF="#support">supporting</A>
&middot;
<A HREF="demo.html">live demo</A>
&middot;
<A HREF="map.html">site map</A>

<P>
<TABLE>
<TR>
<TD WIDTH="45%">

<H2><A NAME="what">Welcome!</A></H2>

<P>
Lua is a powerful and fast programming language
that is easy to learn and use and to embed into your application.

<P>
Lua is designed to be a lightweight embeddable scripting language
and is used for
<A HREF="uses.html">all sorts of applications</A>
from games to web applications and image processing.

<P>
See the
<A HREF="about.html">about</A> page
for details
and some reasons why you should choose Lua.

<P>
See what Lua programs look like in the
<A HREF="demo.html">live demo</A>.

<H2><A NAME="learning">Learning</A></H2>

<A HREF="http://www.amazon.com/exec/obidos/ASIN/859037985X/lua-news-20">
<IMG style="text-decoration: none; margin-left: 24px"
SRC="pil/capa3.jpg" TITLE="buy from Amazon" ALT="" BORDER=1 ALIGN="right" HEIGHT=100></A>

<P>
A good place to start learning Lua is the book
<A HREF="pil/">Programming in Lua</A>.
See also
<A HREF="http://www.dcc.ufrj.br/~fabiom/lua/">course notes</A>
based on this book.

<P>
The official definition of the Lua language is given in the
<A HREF="manual/5.2/">reference manual</A>.

<P>
See the
<A HREF="docs.html">documentation</A> page
and the
<A HREF="http://lua-users.org/wiki/LuaDirectory">wiki</A>
for more.

<H2><A NAME="help">Getting help</A></H2>

<P>
Our
<A HREF="community.html">community</A>
is friendly and will most probably help you if you need.
Just visit
the <A HREF="lua-l.html">mailing list</A>,
the <A HREF="http://lua-users.org/wiki/IrcChannel">chat room</A>,
the <A HREF="http://forum.luahub.com/">forum</A>,
and
<A HREF="http://stackoverflow.com/questions/tagged/lua">stackoverflow</A>.

<P>
See also
the
<A HREF="faq.html">FAQ</A>,
the community-maintained
<A HREF="http://lua-users.org/wiki/">wiki</A>
and
<A HREF="http://lua-users.org/wiki/LuaFaq">LuaFaq</A>,
and the much longer
<A HREF="http://www.luafaq.org/">uFAQ</A>.

<H2><A NAME="tools">Tools</A></H2>
<P>
If you need to
complement the standard Lua libraries to handle more complex tasks,
the
<A HREF="http://lua-users.org/wiki/">lua-users wiki</A>
lists many
<A HREF="http://lua-users.org/wiki/LuaAddons">user-contributed addons</A>
for Lua,
including
tools, libraries, full distributions, and
<A HREF="http://lua-users.org/wiki/LuaBinaries">binaries</A>
for several platforms.

<P>
You can find many user-contributed modules for Lua in
<A HREF="http://luarocks.org/">LuaRocks</A>
and in
<A HREF="https://lua-toolbox.com/">Lua Toolbox</A>.

<P>
Try also
<A HREF="http://luadist.org/">LuaDist</A>,
a multi-platform distribution of the Lua that includes batteries.

<H2><A NAME="support">Supporting</A></H2>

<P>
You can help to
<A HREF="donations.html">support the Lua project</A>
by
<A HREF="donations.html#books">buying a book</A>
or by making a
<A HREF="donations.html#donation">donation</A>.

<P>
You can also help to spread the word about Lua by buying Lua products
at
<A HREF="http://www.zazzle.com/Lua_Store">Zazzle</A>,
<A HREF="http://www.cafepress.com/lualang">CafePress</A>,
and
<A HREF="http://www.fibers.com/shop/Lua">Fibers</A>.

<P>
<A HREF="http://astore.amazon.com/lua-store-20"><IMG SRC="images/amazon.gif" ALT="[buy at the Lua Bookstore at Amazon]" BORDER=0 TITLE="buy at the Lua Bookstore at Amazon"></A>
&nbsp;&nbsp;&nbsp;&nbsp;
<A HREF="donations.html#donation"><IMG SRC="images/donate.gif" ALT="[make a donation to the Lua project]" BORDER=0 TITLE="make a donation to the Lua project"></A>

<TD CLASS="gutter">
<TD WIDTH="45%">

<H2><A NAME="installing">Installing</A></H2>

<P>
Use the
<A HREF="demo.html">live demo</A>
to play with Lua
if you don't want to install anything on your computer.

<P>
To run Lua programs on your computer,
you'll need a standalone Lua interpreter
and perhaps some additional Lua libraries.
Use your favorite text editor to write your Lua programs.
Make sure to save your programs as plain text.

<H3>Windows</H3>
<P>
If you use Windows,
try
<A HREF="http://luaforwindows.luaforge.net/">Lua for Windows</A>,
an easy-to-use distribution of Lua packed with several useful libraries.
Try also
<A HREF="http://luadist.org/">LuaDist</A>,
a multi-platform distribution of the Lua that includes batteries.

<H3>Unix</H3>
<P>
If you use Linux or Mac OS X,
Lua is either already installed on your system or there is a Lua package for it.
Make sure you get the latest release of Lua
(currently 5.2.3).

<P>
Lua is also quite easy to build from source,
as explained below.

<H3>Building from source</H3>

<P>
Lua is very easy to build and install.
Just <A HREF="download.html">download</A> it and
follow the
<A HREF="manual/5.2/readme.html">instructions</A>
in the package.

<P>
Here is a simple terminal session that downloads the
<A HREF="ftp/lua-5.2.3.tar.gz">current release</A>
of Lua and builds it in a Linux system:
<PRE STYLE="padding-left: 1em">
curl -R -O http://www.lua.org/ftp/lua-5.2.3.tar.gz
tar zxf lua-5.2.3.tar.gz
cd lua-5.2.3
make linux test
</PRE>
For Mac OS X, use <CODE>make macosx test</CODE>.

<P>
If you use Windows and want to build Lua from source,
there are
<A HREF="http://lua-users.org/wiki/BuildingLuaInWindowsForNewbies">detailed instructions</A>
in the
<A HREF="http://lua-users.org/wiki/">wiki</A>.

<H3>Embedding</H3>
<P>
To embed Lua into your program,
you'll need Lua headers to compile your program and
a Lua library to link with it.
You'll also need a C or C++ compiler for your program,
because the Lua headers and library are written in C.
If you're gettting a ready-made Lua package for your platform,
you'll probably need the development package as well.

</TR>
</TABLE>

<HR>
<SMALL CLASS="footer">
Last update:
Fri Dec  6 10:45:29 BRST 2013
</SMALL>
<!--
Last change: Lua 5.2.3 released
-->

</BODY>
</HTML>
